package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by LN on 2017/7/24.10:33
 */
@Entity
@Table(name = "coupon_present_base")
public class CouponPresentBaseEntity extends BaseEntity {
    private String presentNo;
    private String openid;
    private Date giveEndDate;
    private String remark;
    private String radioUrl;
    private String imgUrl;
    private String sta;
    private Integer partsNum;
    private Integer receivedNum;
    private Integer numPerPart;
    private String goodCode;

    @Basic
    @Column(name = "present_no")
    public String getPresentNo() {
        return presentNo;
    }

    public void setPresentNo(String presentNo) {
        this.presentNo = presentNo;
    }

    @Basic
    @Column(name = "openid")
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    @Basic
    @Column(name = "give_end_date")
    public Date getGiveEndDate() {
        return giveEndDate;
    }

    public void setGiveEndDate(Date giveEndDate) {
        this.giveEndDate = giveEndDate;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "radio_url")
    public String getRadioUrl() {
        return radioUrl;
    }

    public void setRadioUrl(String radioUrl) {
        this.radioUrl = radioUrl;
    }

    @Basic
    @Column(name = "img_url")
    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    @Basic
    @Column(name = "sta")
    public String getSta() {
        return sta;
    }

    public void setSta(String sta) {
        this.sta = sta;
    }

    @Basic
    @Column(name = "parts_num")
    public Integer getPartsNum() {
        return partsNum;
    }

    public void setPartsNum(Integer partsNum) {
        this.partsNum = partsNum;
    }

    @Basic
    @Column(name = "received_num")
    public Integer getReceivedNum() {
        return receivedNum;
    }

    public void setReceivedNum(Integer receivedNum) {
        this.receivedNum = receivedNum;
    }

    @Basic
    @Column(name = "num_per_part")
    public Integer getNumPerPart() {
        return numPerPart;
    }

    public void setNumPerPart(Integer numPerPart) {
        this.numPerPart = numPerPart;
    }

    @Basic
    @Column(name = "good_code")
    public String getGoodCode() {
        return goodCode;
    }

    public void setGoodCode(String goodCode) {
        this.goodCode = goodCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CouponPresentBaseEntity that = (CouponPresentBaseEntity) o;

        if (presentNo != null ? !presentNo.equals(that.presentNo) : that.presentNo != null) return false;
        if (openid != null ? !openid.equals(that.openid) : that.openid != null) return false;
        if (giveEndDate != null ? !giveEndDate.equals(that.giveEndDate) : that.giveEndDate != null) return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        if (radioUrl != null ? !radioUrl.equals(that.radioUrl) : that.radioUrl != null) return false;
        if (imgUrl != null ? !imgUrl.equals(that.imgUrl) : that.imgUrl != null) return false;
        if (sta != null ? !sta.equals(that.sta) : that.sta != null) return false;
        if (partsNum != null ? !partsNum.equals(that.partsNum) : that.partsNum != null) return false;
        if (receivedNum != null ? !receivedNum.equals(that.receivedNum) : that.receivedNum != null) return false;
        if (numPerPart != null ? !numPerPart.equals(that.numPerPart) : that.numPerPart != null) return false;
        return goodCode != null ? goodCode.equals(that.goodCode) : that.goodCode == null;
    }

    @Override
    public int hashCode() {
        int result = presentNo != null ? presentNo.hashCode() : 0;
        result = 31 * result + (openid != null ? openid.hashCode() : 0);
        result = 31 * result + (giveEndDate != null ? giveEndDate.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (radioUrl != null ? radioUrl.hashCode() : 0);
        result = 31 * result + (imgUrl != null ? imgUrl.hashCode() : 0);
        result = 31 * result + (sta != null ? sta.hashCode() : 0);
        result = 31 * result + (partsNum != null ? partsNum.hashCode() : 0);
        result = 31 * result + (receivedNum != null ? receivedNum.hashCode() : 0);
        result = 31 * result + (numPerPart != null ? numPerPart.hashCode() : 0);
        result = 31 * result + (goodCode != null ? goodCode.hashCode() : 0);
        return result;
    }
}
